﻿using System.ComponentModel;

namespace LDSCore
{
    /// <summary>
    /// 窗体状态
    /// </summary>
    public enum FormState
    {
        None = 0,

        /// <summary>
        /// 加载中
        /// </summary>
        Loading = 1,

        /// <summary>
        /// 加载完成
        /// </summary>
        Loaded = 2
    }

    /// <summary>
    /// 设备状态
    /// </summary>
    public enum DeviceState
    {
        /// <summary>
        /// 离线
        /// </summary>
        Offline,

        /// <summary>
        /// 在线
        /// </summary>
        Online,

        /// <summary>
        /// 雷击
        /// </summary>
        Alarm
    }

    /// <summary>
    /// 操作类型
    /// </summary>
    public enum OpType
    {
        /// <summary>
        /// 登录
        /// </summary>
        [Description("登录")]
        Login = 1,

        /// <summary>
        /// 修改密码
        /// </summary>
        [Description("修改密码")]
        ModifyPwd = 2,

        /// <summary>
        /// 用户管理
        /// </summary>
        [Description("用户管理")]
        UserManage = 3,

        /// <summary>
        /// 信息查询
        /// </summary>
        [Description("信息查询")]
        QueryInfo = 4,

        /// <summary>
        /// 设备配置
        /// </summary>
        [Description("设备配置")]
        SetConfig = 5
    }

    /// <summary>
    /// 图表查询类型
    /// </summary>
    public enum ChartQueryType
    {
        /// <summary>
        /// 当前
        /// </summary>
        [Description("实时显示")]
        Now = 0,

        /// <summary>
        /// 历史
        /// </summary>
        [Description("历史查询")]
        History = 1
    }

    /// <summary>
    /// 命令类型
    /// </summary>
    public enum MsgType : byte
    {
        #region 系统级命令（x00-0x1F）

        /// <summary>
        /// 设备复位
        /// </summary>
        [Description("设备复位")]
        ZGCMD_RESET = 0x00,

        /// <summary>
        /// 恢复出厂值
        /// </summary>
        [Description("恢复出厂值")]
        ZGCMD_DEFAULT = 0x01,

        /// <summary>
        /// 读取系统信息
        /// </summary>
        [Description("读取系统信息")]
        ZGCMD_READ_SYSINFO = 0x02,

        /// <summary>
        /// 发送系统信息
        /// </summary>
        [Description("发送系统信息")]
        ZGCMD_SEND_SYSINFO = 0x03,

        /// <summary>
        /// 系统配置
        /// </summary>
        [Description("系统配置")]
        ZGCMD_SYSTEM_CONFIG = 0x04,

        /// <summary>
        /// 设置ID
        /// </summary>
        [Description("设置ID")]
        ZGCMD_SET_ID = 0x05,

        /// <summary>
        /// 读取系统时间
        /// </summary>
        [Description("读取系统时间")]
        ZGCMD_READ_SYSTIME = 0x06,

        /// <summary>
        /// 发送系统时间
        /// </summary>
        [Description("发送系统时间")]
        ZGCMD_SEND_SYSTIME = 0x07,

        /// <summary>
        /// 时间同步
        /// </summary>
        [Description("时间同步")]
        ZGCMD_SET_SYSTIME = 0x08,

        /// <summary>
        /// 修改密码
        /// </summary>
        [Description("修改密码")]
        ZGCMD_CHANGE_PWD = 0x09,

        /// <summary>
        /// 查询工作状态
        /// </summary>
        [Description("查询工作状态")]
        ZGCMD_CHECK_STATE = 0x0A,

        #endregion

        #region 数据级命令（x20-0x5F）

        /// <summary>
        /// 读取报警次数
        /// </summary>
        [Description("读取报警次数")]
        ZGCMD_READ_ALARMCOUNT = 0x20,

        /// <summary>
        /// 发送报警次数
        /// </summary>
        [Description("发送报警次数")]
        ZGCMD_SEND_ALARMCOUNT = 0x21,

        /// <summary>
        /// 清空存储记录
        /// </summary>
        [Description("清空存储记录")]
        ZGCMD_CLEAR_RECORDS = 0x22,

        /// <summary>
        /// 读取一条雷电流
        /// </summary>
        [Description("读取一条雷电流")]
        ZGCMD_READ_RECORD = 0x23,

        /// <summary>
        /// 发送一条雷电流
        /// </summary>
        [Description("发送一条雷电流")]
        ZGCMD_SEND_RECORD = 0x24,

        /// <summary>
        /// 读取多条雷电流
        /// </summary>
        [Description("读取多条雷电流")]
        ZGCMD_READ_MORE_RECORD = 0x25,

        /// <summary>
        /// 发送多条雷电流
        /// </summary>
        [Description("发送多条雷电流")]
        ZGCMD_SEND_MORE_RECORD = 0x26,

        /// <summary>
        /// 读取SPD状态
        /// </summary>
        [Description("读取SPD状态")]
        ZGCMD_READ_SPD = 0x27,

        /// <summary>
        /// 发送SPD状态
        /// </summary>
        [Description("发送SPD状态")]
        ZGCMD_SEND_SPD = 0x28,

        /// <summary>
        /// 读取多个SPD状态
        /// </summary>
        [Description("读取多个SPD状态")]
        ZGCMD_READ_MORE_SPD = 0x29,

        /// <summary>
        /// 发送多个SPD状态
        /// </summary>
        [Description("发送多个SPD状态")]
        ZGCMD_SEND_MORE_SPD = 0x2A,

        #endregion

        #region 网络级命令（x60-0x6F）

        /// <summary>
        /// 注册网络
        /// </summary>
        [Description("注册网络")]
        ZGCMD_NET_REGISTER = 0x60,

        /// <summary>
        /// 心跳
        /// </summary>
        [Description("心跳")]
        ZGCMD_NET_HEARTBEAT = 0x61,

        /// <summary>
        /// 心跳间隔
        /// </summary>
        [Description("心跳间隔")]
        ZGCMD_NET_HEARTINTERVAL = 0x62,

        /// <summary>
        /// 服务器IP
        /// </summary>
        [Description("服务器IP")]
        ZGCMD_NET_SERVICEIP = 0x63,

        /// <summary>
        /// 服务器端口
        /// </summary>
        [Description("服务器端口")]
        ZGCMD_NET_SERVICEPORT = 0x64,

        #endregion

        #region 命令应答（x70-0x7F）

        /// <summary>
        /// 应答OK
        /// </summary>
        [Description("应答OK")]
        ZGCMD_ANSWER_OK = 0x70,

        /// <summary>
        /// 应答错误
        /// </summary>
        [Description("应答错误")]
        ZGCMD_ANSWER_ERROR = 0x71,

        /// <summary>
        /// 未知错误
        /// </summary>
        [Description("未知错误")]
        ZGCMD_ERR_UNKNOWN = 0x72,

        /// <summary>
        /// 帧头错误
        /// </summary>
        [Description("帧头错误")]
        ZGCMD_ERR_FRAMEHEAD = 0x73,

        /// <summary>
        /// 数据长度过短
        /// </summary>
        [Description("数据长度过短")]
        ZGCMD_ERR_LESSLEN = 0x74,

        /// <summary>
        /// 校验出错
        /// </summary>
        [Description("校验出错")]
        ZGCMD_ERR_CHECKCODE = 0x75,

        /// <summary>
        /// 无效命令
        /// </summary>
        [Description("无效命令")]
        ZGCMD_ERR_INVALID = 0x76,

        /// <summary>
        /// 没有权限
        /// </summary>
        [Description("没有权限")]
        ZGCMD_ERR_NOPERMISSION = 0x77,

        /// <summary>
        /// 密码错误
        /// </summary>
        [Description("密码错误")]
        ZGCMD_ERR_WRONGPWD = 0x78

        #endregion
    }
}
